Skip to content

feat: add custom calendar support via plist#1292

Open
rantoniuk wants to merge 1 commit into
TheBoredTeam:devfrom
rantoniuk:add-cal-support
Open

feat: add custom calendar support via plist#1292
rantoniuk wants to merge 1 commit into
TheBoredTeam:devfrom
rantoniuk:add-cal-support

Conversation

@rantoniuk

@rantoniuk rantoniuk commented May 29, 2026

Copy link
Copy Markdown

Problem

Clicking a calendar event in the Notch always opened Apple Calendar, ignoring the macOS Default Calendar App system setting (#1286).

This is alternative implementation to (#1288)

Root cause: EventModel.calendarAppURL() hardcoded the ical://ekevent/… URL scheme. This scheme is Apple Calendar's proprietary internal protocol — macOS never routes it to any third-party app, regardless of the system preference. The Default Calendar App setting only affects .ics file opens and webcal:// subscription URLs, not ical://.

Solution

Detection

The default calendar app is resolved at runtime by querying which application handles webcal:// links — the same signal macOS uses for the system
preference:

NSWorkspace.shared.urlForApplication(toOpen: URL(string: "webcal://x"))

Data-driven URL routing

A new bundled resource — CalendarAppURLSchemes.plist — maps each calendar app's bundle ID to a URL template. Two placeholders are supported:

Placeholder Value
{id} percent-encoded EKEvent.calendarItemIdentifier
{date} ISO-8601 recurrence date prefix for Apple Calendar (/yyyy-MM-dd'T'HH:mm:ssZ), empty string for non-recurring events

Initial entries:

App Bundle ID Template
Apple Calendar com.apple.iCal ical://ekevent{date}/{id}?method=show&options=more
Fantastical com.flexibits.fantastical2.mac x-fantastical2://show?eventIdentifier={id}
BusyCal com.busymac.busycal3 busycal://open?calendarItemIdentifier={id}

If the plist has no entry for the current default app, the code falls back to the original ical:// URL (Apple Calendar behaviour).

Adding support for a new calendar app

No Swift changes needed — just a one-line addition to the plist:

# 1. Find the bundle ID
mdls -name kMDItemCFBundleIdentifier /Applications/YourCalendar.app

# 2. Add to CalendarAppURLSchemes.plist:
# <key>com.example.yourcalendar</key>
# <string>yourcal://open?id={id}</string>

Known limitation

Microsoft Outlook for Mac is not supported: it does not register as a webcal:// handler (so it cannot be detected) and has no documented URL
scheme for opening an existing calendar event by identifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant